!pr1
Adapting the Output Format of Rak-Ware DISASM.......Bob Kovacs

This technical note describes the format table used within DISASM 2.2e, which can be modified to adapt the output text file format to other assemblers.  Even if you never plan to modify DISASM, or even if you don't own a copy of DISASM, you can learn a lot about the use of configuration tables by studying what follows.

The current version of the disassembler provides three different output formats to support the DOS ToolKit, S-C, and LISA assemblers.  The format table contains various attributes which are unique to each assembler.  The table begins at location $1331 and is $3F bytes long.  Let's first examine the table and then determine how to adapt it to other assembler formats.

!lm+5
 Item      ToolKit      S-C          LISA
---------  -----------  -----------  -----------

comment    AA     *     AA     *     BB     ;
firstchr   00     none  89     ^I    00     none
tabchr1    A0     spc   89     ^I    A0     spc
tabchr2    A0     spc   A0     spc   A0     spc
opchr      C1     A     00     none  00     none
pgzchr     C5D1D5 EQU   AEC5D1 .EQ   C5D0DA EPZ
extchr     C5D1D5 EQU   AEC5D1 .EQ   C5D1D5 EQU
hexchr     C4C6C2 DFB   AEC8D3 .HS   C8C5D8 HEX
orgchr     CFD2C7 ORG   AECFD2 .OR   CFD2C7 ORG
prechr     AA0000 *     000000 none  C9CED3 INS
postchr    00     none  98     ^X    85     ^E

!lm+11
!pp-11
 comment:  the character used at the beginning of a line to signify a comment line.

firstchr:  the character ouput at the beginning of each line.

 tabchr1:  the character used to tab to the opcode field.

 tabchr2:  the character used to tab to the operand field.

   opchr:  operand for impled accumulator instructions (ASL, LSR, ROR, ROL).

  pgzchr:  directive for page zero declarations.

  extchr:  directive for absolute declarations.

  hexchr:  directive for data tables.

  orgchr:  directive for setting the program origin.

  prechr:  preamble sequence for initialization of the assembler.

 postchr:  postamble character for termination of the assembler's loading operation.

!pp0
!lm-11
!lm-5
You will find that it is relatively simple to modify the format table for other assemblers.  First, determine which of the three existing formats is to be overwritten (just pick the one you think you'll need the least).  Then determine the format data which is appropriate to your assembler.  BLOAD DISASM, enter the monitor, and stuff the new values into the table.  Finally BSAVE DISASM,A$800,L$D00.

Or, if you have purchased the source code of DISASM 2.2e (or created your own using DISASM!), you can merely edit the table with your assembler and re-assemble the program.

You might also need or want to change some other paramteters, which are not in the format table:

!lm+5
Label Prefix:  located at $132E, the current value is C9DAD8 (the letters "IZX").  These letters are used to indicate internal, pagezero, and external labels in the generated text file.

Menu Table:  located at $1300, this table contains the names of the three assemblers listed in the first menu.  Each name is stored in ASCII, followed by a return ($0D) and a terminator ($00).

Label Name Separator:  A period ($AE) is output as the second character in every generated label name.  This can be changed to any other character by editing the LDA #$AE instruction at location $0EA4.

!lm-5
I would be interested in hearing from any of you who have already modified DISASM.  This kind of feedback can lead to new versions with even more powerful features.
